export default {
  // Target: https://go.nuxtjs.dev/config-target
  target: 'static',

  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: '小R资源',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '小R资源，为你分享。' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    'ant-design-vue/dist/antd.css',
    '@/assets/css/main.css',
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    '@/plugins/antd-ui',
    '@/plugins/global',
    '@/plugins/components-register',
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    ['@nuxtjs/axios', { anotherOption: true }]
  ],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    extend: (config) => {
          const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));

          svgRule.test = /\.(png|jpe?g|gif|webp)$/;

          config.module.rules.push({
            test: /\.svg$/,
            use: [
              'babel-loader',
              'vue-svg-loader',
            ],
          });
        },
  },

  loading: '@/components/common/loading/loading.vue',

  loadingIndicator: {
    name: 'circle',
    color: '#1B9CFC',
    background: 'white'
  },

  generate: {
    fallback: true,
    subFolders: false,
  }
}
